<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>固定定位</title>
    <style>
        div{
            height: 2000px;
            background: #35ac5d;
        }
        #box{
            width: 80px;
            height: 400px;
            background: #0040ff;
            position: fixed;
            right: 20px;
            top: 200px;
        }
    </style>
</head>
<body>
1
<div>
<div id="box"></div>
</div>
2
</body>
</html>